<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #box {
            width: 300px;
            height: 300px;
            border: 1px solid #333;
            /* auto 内容溢出时添加滚动条 内容没有溢出时没有滚动条 */
            overflow: auto; 
        }

        #box div{
            width: 400px;
            height: 600px;
        }
    </style>
</head>
<body>
    <div id="box">
        <div>你是个麻瓜</div>
    </div>
</body>
</html>